home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / advc11.zip / MOUSE.TXT < prev    next >
Text File  |  1987-02-07  |  2KB  |  34 lines

  1.      There are a number of functions in ADVC which are intended to be used
  2. with a mouse.  In specific, they rely on a Microsoft-compatible mouse.
  3. Most of the functions are self-explanatory, but the mouse cursor location
  4. needs to be explained further.
  5.  
  6.      The mouse cursor location is automatically updated by the mouse
  7. driver.  You don't need to write any control routines for that at all.  In
  8. order to provide a generalized interface, though, the location is returned
  9. in a somewhat unusual manner.  It may be helpful to go into that in a bit
  10. more depth.
  11.  
  12.      The mouse cursor location is returned as a range of values equivalent
  13. to the dimensions of a CGA screen.  That is, the columns range from 0-639,
  14. and the rows from 0-199.  This holds true whether the display is in text
  15. or one of the color modes.  To find where the cursor actually is, then,
  16. requires conversion factors.
  17.  
  18.      If you're in hi-res color mode (640x200), there is no conversion
  19. factor.  The values directly correspond to the screen location.
  20.  
  21.      If you're in lo-res color mode (320x200), you need to apply a
  22. conversion factor of two to the columnar location.  That is, if you want
  23. to position to the middle of the screen, you must set the mouse to column
  24. 160 * 2, or 320.  The row location is still accurate, however.
  25.  
  26.      If you're in text mode (80x25), you need to apply conversion factors
  27. of eight to both the column and row locations, and add an offset of one.
  28. For example, if the mouse locations were returned as column 80, row 24,
  29. you would translate this to meaning text column 11, which is 80 / 8 + 1,
  30. and text row 4, which is 24 / 8 + 1.  In effect, a text mode character is
  31. equivalent to an 8x8 block of graphics pixels.  The offset is added
  32. because the graphics screen has its origin at (0,0), whereas the text
  33. screen has its offset at (1,1) in the usual notation.
  34.